/*
 * @Description  :
 * @Autor        : guoxi
 * @Date         : 2022-10-11 14:26:52
 * @LastEditors  : Please set LastEditors
 * @LastEditTime : 2022-10-27 17:40:14
 * @FilePath     : \snow-frontend-pc\src\main.ts
 */
import { createApp, Directive } from "vue";
import App from "./App.vue";
import "./style/element-theme.scss";
import ElementPlus from "element-plus";
import { usI18n } from "../src/plugins/i18n";
import router from "./router";
import { setupStore } from "/@/store";
// import { getServerConfig } from "./config";
import "font-awesome/css/font-awesome.css";

// 导航进度条样式
import "nprogress/nprogress.css";
// 导入公共样式
import "./style/index.scss";

// 导入字体图标
import "./assets/iconfont/iconfont.js";
import "./assets/iconfont/iconfont.css";
import "./assets/snowfont/iconfont.js";
import "./assets/snowfont/iconfont.css";

const app = createApp(App);

// 响应式storage
// import Storage from "responsive-storage";

// app.use(Storage, {
//   routesInStorage: {
//     type: Array,
//     default: Storage.getData(undefined, "routesInStorage") ?? [
//       {
//         path: "/welcome",
//         parentPath: "/",
//         meta: {
//           title: "message.hshome",
//           icon: "el-icon-s-home",
//           showLink: true,
//           savedPosition: false
//         }
//       }
//     ]
//   },
//   // 国际化 默认中文zh
//   locale: {
//     type: Object,
//     default: Storage.getData(undefined, "locale") ?? {
//       locale: "zh"
//     }
//   },
//   // layout模式以及主题
//   layout: {
//     type: Object,
//     default: Storage.getData(undefined, "layout") ?? {
//       layout: "vertical-dark"
//     }
//   }
// });

// 自定义指令
import * as directives from "/@/directives";
// import { RunWork } from "./utils/runwork/index";

Object.keys(directives).forEach(key => {
  app.directive(key, (directives as { [key: string]: Directive })[key]);
});

setupStore(app);

app.use(ElementPlus, { size: "small" }).use(router).use(usI18n);

router.isReady();

app.mount("#app");

// RunWork.sendMsg(
//   "xxx验货流程",
//   "guoxi9",
//   ["1.xxxxxxx", "2.aaaaaaaaa"],
//   "http://10.200.6.55:8700/#/login"
// );
